import SpatialReference from "@arcgis/core/geometry/SpatialReference";
import TileInfo from "@arcgis/core/layers/support/TileInfo";
import TileLayer from "@arcgis/core/layers/TileLayer"; //瓦片
import Basemap from "@arcgis/core/Basemap";
import { config } from "@/config";

export const initWidget = () => {
  const img_c = new TileLayer({
    url: config.imgUrl,
    title: "影像底图",
  });
  const vec_c = new TileLayer({
    url: config.vecUrl,
    title: "矢量底图",
  });

  // 矢量底图
  const baseMap_vec = new Basemap({
    baseLayers: [vec_c],
    // referenceLayers: [cva_c],
    title: "矢量底图",
    // spatialReference,
    thumbnailUrl: "/basemap/basemap-sl.png",
  });

  // 影像底图
  const baseMap_img = new Basemap({
    baseLayers: [img_c],
    // referenceLayers: [cia_c],
    title: "影像底图",
    // spatialReference,
    thumbnailUrl: "/basemap/basemap-yx.png",
  });
  return {
    baseMap_img,
    baseMap_vec,
  };
};
